package day0318.bigdecimal;

import java.math.BigDecimal;
import java.util.Arrays;

/**
 * @Author Stringzhua
 * @Date 2024/3/18 18:44
 * description:
 */
public class demo04 {
    public static void main(String[] args) {
        BigDecimal bd1 = new BigDecimal("0.4");
        BigDecimal bd2 = new BigDecimal("1.0");

        //元素1 商
        //元素2 余数
        BigDecimal[] bigDecimals = bd2.divideAndRemainder(bd1);
        System.out.println(Arrays.toString(bigDecimals));

        if (bigDecimals[1].doubleValue() == 0) {
            System.out.println("能被整除");
        } else {
            System.out.println("不能被整除");
        }


        BigDecimal bd = new BigDecimal("-90.0");
        System.out.println("=========");
        System.out.println(bd.signum());
        System.out.println("=======");

        if (bigDecimals[1].signum() == 0) {
            System.out.println("能被整除");
        }
    }
}
